﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcMusicStore.Models;

namespace MvcMusicStore.Controllers
{
    public class StoreController : Controller
    {
        MvcMusicStore.Models.MusicStoreEntities storedb = new MvcMusicStore.Models.MusicStoreEntities();
        //
        // GET: /Store/

        public ActionResult Index()
        {
            List<Genre> listGenre = new List<Genre>();
            try
            {
                listGenre = storedb.Genres.ToList();
            }
            catch (Exception ex)
            {
                string str = ex.ToString();
            }
            
            return View(listGenre);
        }

        public ActionResult Details(int id)
        {
            var album = new Album { Title = "Album " + id };
            return View(album);
        }

        public ActionResult Browse(string genre)
        {
            var genreObj = new Genre
            {
                Name = genre
            };
            return View(genreObj);
        }

    }
}
